/**
 * Course Project for User Interface Programming I, 2011
 * Group 19
 */
package justdoit.view.model;

import java.util.List;
import javax.swing.AbstractListModel;
import justdoit.model.Task;

/**
 *
 * @author Can
 */
public class TaskListModel extends AbstractListModel {

    private List<Task> tasks;
    private String displayContent;

    public TaskListModel(List<Task> tasks) {
        this.tasks = tasks;
    }

    public int getSize() {
        return this.tasks.size();
    }

    public Object getElementAt(int index) {
        return this.tasks.get(index).getDescription();
    }

    public void setTasks(List<Task> tasks) {
        this.tasks = tasks;
    }

    public Task getTask(int index) {
        return tasks.get(index);
    }
}
